<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<style>
			.red{
				color: red;
			}
			.blue{
				color: blue;
			}
			.yellow{
				color: yellow;
			}
		</style>
	</head>
	<body>
		<ul>
			<li class="red">java</li>
			<li class="blue">c++</li>
			<li class="yellow">php</li>
		</ul>
		<script>
			window.onload=function(){
				//var cli=document.getElementsByTagName("li")[0];
				//console.log(cli)
				/* 
				 query:查询 selector:选择器
				 querySelector：获取单个元素
				 获取到满足条件的第一个
				 */
				var javali=document.querySelector("li")
				console.log(javali)
				var javaall=document.querySelectorAll("li")
				console.log(javaall)
			}
			
		</script>
	</body>
</html>